<?php
use yii\helpers\Url;


var_dump(Url::to(['site/index']));
?>

<script>
    //window.location.href = "<?//=Url::to(['site'])?>//";

</script>